// just 1-order polynomial (linear) fit

void fitPol1(){
  const double p[] = {7.08159e+02, 7.91482e+02, 8.74590e+02, 9.54287e+02,
    1.03102e+03, 1.10745e+03, 1.18268e+03, 1.26535e+03, 1.33887e+03, 1.41504e+03,
    1.48946e+03, 1.56087e+03, 1.64210e+03, 1.71793e+03, 1.78097e+03};
  static const int n = sizeof(p)/sizeof(double);
  double x[n]{};
  for(int i = n; i--;) x[i] = i;

  TGraph *g = new TGraph(n, x, p);
  g->SetMarkerColor(2);
  g->SetMarkerStyle(20);
  TCanvas *c = new TCanvas("c", "Linear Fit", 800, 600);
  g->Draw();
  g->Fit("pol1");
} // end function fitZ
